home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
DEMO_VGA
/
DEMOEGA1.LZH
/
WALPAPER.DOC
< prev
next >
Wrap
Text File
|
1986-08-22
|
4KB
|
98 lines
Walpaper.com is a Turbo Pascal approximation of the
algorithms expressed as Connett's and Martin's in the Sept.
Scientific American magazine in the column "Computer
Recreations."
Connett's algorithm is expressed as:
for i <-- 1 to 100
for i <-- 1 to 100
x <-- corna + (side*i/100)
y <-- cornb + (side*i/100)
z <-- x*x+y*y
c <-- int(z)
In low resolution mode I have substituted 320 and 200 for 100, in
high resolution mode I have substituted 640 and 200 for 100.
Such is life.
Martin's algorithm is expressed as:
x <-- y-sign(x)*sqrt(abs(b*x-c))
y <-- a-x
The program isn't meant to be anything except a way of playing
with the algorithm without having to do any programming. The
aspect ratio of the IBM and compatibles, along with display
constraints in Turbo Pascal, do not allow the program to
faithfully reproduce the diagrams shown in the magazine. It is
possible, however, to see that the patterns produced do have a
kind of symmetry, although they are not symmetrical!
I have tried to keep out the minor irritants which might
cause the program to bomb, but I surely have not gotten them all.
The program expects a CGA card or equivalent, and if you can run
the IBM version of Turbo Pascal you should be ok. In Connett's
algorithm values are limited to about 1000, in Martin's algorithm
the values are limited to +/- 10000 for a,b, and c, and the
number of iterations limited to about 10000000. This is not a
guarantee that all values in that range will run, or that they
will produce a meaningful display.
When the machine is drawing a picture, pressing any key
during the display will allow you to abandon the picture, save
the picture, or continue. Saved pictures may be displayed with
this program.
The images produced sometimes represent, in the words of
Dewdney, "details strongly reminiscent of vascular bundles:
could it be the outer rind of a monocotyledon in cross section?"
Dewdney goes on to quote B. Martin as saying: "Clearly these
curious configurations show us that the rules responsible for the
construction of elaborate living tissue structures could be
absurdly simple."
Most values produce something. In Connett's algorithm most
anything under the range of 1000 for any of the variables will
produce an image. In Martin's algorithm values that are known to
produce an image are: -40,-14,-750; -200,10,500; -250,169,-60;
for a,b, and c. Most anything works, and you are certainly not
limited to whole numbers, 34.6,-7.4,13.8 will also produce an
image.
[SysOp's Note: When entering colors in low res mode, leave a space
between each (don't use a comma as shown).]
The source code is now included, so thems that are smarter
than me can see what a klutz I am in my implementations of the
algorithms. Those who are interested are STRONGLY encouraged to
get (oh go on and buy it, it's not that expensive and it is good)
Turbo Pascal from:
Borland International
4585 Scotts Valley Drive
Scotts Valley, CA 95066
and:
Scientific American
415 Madison Avenue
New York, NY 10017
so that they can read the article itself.
One final apology: I have often been frustrated by playing
with some of the things in Scientific American simply because I
didn't have time to do any programming. This is a fast and
furious approach to get a few of the ideas running, and I'm
uploading the program not because I think it's great, but because
I have often wanted something to play with myself. Well, this at
least draws images, and if you run GRAPHICS.COM first you can
print them if you have a graphics type printer. It would be nice
if someone really runs with this . . . if I can help I will . . .
Galen Hekhuis
UVa Medical Center
Box 449, Jordan Hall
Charlottesville, VA 22908
Ä